package com.dwxt.cdms.controller;

import com.dwxt.cdms.base.Page;
import com.dwxt.cdms.entity.Station;
import com.dwxt.cdms.service.StationService;
import com.dwxt.common.base.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 区域管理
 * @author chendq
 * @date 2021/10/18
 */
@RequestMapping("/cdms/station")
@RestController
public class StationController {

    @Autowired
    private StationService stationService;

    /**
     * 分页查询
     */
    @RequestMapping("/page")
    public BaseResult page(Page page,String name) {
        return stationService.page(page,name);
    }

    /**
     * list查询
     */
    @RequestMapping("/list")
    public BaseResult list() {
        return stationService.list();
    }

    /**
     * 新增
     */
    @RequestMapping("/add")
    public BaseResult add(Station station) {
        return stationService.add(station);
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public BaseResult delete(Integer id){
        return stationService.delete(id);
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public BaseResult update(Station station){
        return  stationService.update(station);
    }
}

